package com.movie.api.controller;

import com.movie.api.context.LoginContext;
import com.movie.api.service.UserIsVipService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Slf4j
@RequestMapping("/api/uservip")
public class UserVipController {
    @Resource
    private UserIsVipService userIsVipService;

    @GetMapping("/isvip")
    public boolean isvip() {
        log.info("进入uservip接口");
        String name = LoginContext.getName();

        return userIsVipService.isVip(name);
    }
}
